package net.zjitc.service.impl;

import net.zjitc.dao.ProductDao;
import net.zjitc.dao.impl.ProductDaoImpl;
import net.zjitc.pojo.Evaluate;
import net.zjitc.pojo.Product;
import net.zjitc.service.ProductService;
import net.zjitc.utils.PageBean;

import java.util.List;

/**
 * Created by Administrator on 2017/11/28.
 */
public class ProductServiceImpl implements ProductService {
    ProductDao dao=new ProductDaoImpl();
    @Override
    public PageBean<Product> findPageBean(int currentPage, int pageSize) {
        return dao.findPageBean(currentPage,pageSize);
    }

    @Override
    public int insert(Product product) {
        return dao.insert(product);
    }

    @Override
    public Product findByPid(String pid) {
        return dao.findByPid(pid);
    }

    @Override
    public int update(Product product) {
        return dao.update(product);
    }

    @Override
    public int delete(int pid) {
        return dao.delete(pid);
    }

    @Override
    public List<Product> findAllIsHot(String isHot) {
        return dao.findAllIsHot(isHot);
    }

    @Override
    public Product findByProductPid(int pid) {
        return dao.fingByProductPid(pid);
    }

    @Override
    public List<Evaluate> findEvaluateByPid(int pid) {
        return dao.findEvaluateByPid(pid);
    }

    @Override
    public PageBean<Product> findPageBeanByCid(int page, int pageSize, int cid) {
        return dao.findPageBeanByCid(page,pageSize,cid);
    }

    @Override
    public PageBean<Product> findPageBeanByCsid(int page, int pageSize, int csid) {
        return dao.findPageBeanByCsid(page,pageSize,csid);
    }

    @Override
    public List findNewProduct() {

        int size = 10;
        return dao.findNewProduct(10);
    }


}
